package org.fujay.langchain4jserver.infrastructure.persistence.mybatis.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.fujay.mybatis.core.base.BaseEntity;

import java.io.Serial;
import java.io.Serializable;

/**
 * 应用配置历史持久化实体 (对应 app_config_history 表)
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "app_config_history")
public class AppConfigHistoryPo extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(value = "app_id")
    private Long appId;

    @TableField(value = "version")
    private Integer version;

    /**
     * 配置快照 (JSON格式) 存储 AppConfigSnapshot 对象的 JSON 序列化字符串
     */
    @TableField(
            value = "config_snapshot_json",
            typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    private String configSnapshotJson;

    @TableField(value = "change_description")
    private String changeDescription;
}
